package com.kk.xhr.web.security;

import com.kk.xhr.common.pojo.AccessType;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * @author kkmystery
 * @version 1.0 2021/3/9
 * @since 1.0.0
 */
@Setter
@NoArgsConstructor
public class JwtToken implements AuthenticationToken {
    private String token;
    private AccessType accessType;

    public JwtToken(String token, AccessType accessType) {
        this.token = token;
        this.accessType = accessType;
    }
    public JwtToken(String token){
        this.token = token;
    }

    @Override
    public Object getPrincipal() {
        return this.token;
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    public AccessType getAccessType() {
        return accessType;
    }
}
